package com.mjk.manager.amis.core.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mjk.common.base.model.BaseEntity;
import com.mjk.common.core.jdbc.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@ArcSharding(dataSource = "", table = "sys_menu", userName = "")
public class SysMenu extends BaseEntity {
    public SysMenu() {
        this.PID = "0";
    }
    /**
     * 静态页面
     */
    @Transient
    public static final int TYPE_STATIC_PAGE = 11;
    /**
     * 动态页面
     */
    @Transient
    public static final int TYPE_DYNAMIC_PAGE = 12;
//    @Id
    @ExampleField
    private String id;
    @Filed(comment = "父菜单", lenght = 64, cloum = "PID")
    private String PID;
    @Filed(comment = "菜单名称", lenght = 256, cloum = "NAME")
    private String NAME;
    @Filed(comment = "图标", lenght = 64, cloum = "ICON")
    private String ICON;
    @Filed(comment = "菜单地址(开始于 / 的绝对路径)", lenght = 256, cloum = "URL")
    private String URL;
    @Filed(comment = "菜单类型(1: 菜单组, 2: 页面, 3: 功能/按钮, 4: 调用, 11: 内部静态页面, 12: 动态AMIS页面)", lenght = 10, cloum = "TYPE")
    private Integer TYPE;
    @Filed(comment = "页面标识(动态页面: SYS_PAGE 的 ID 字段, 静态页面: 不含 .json 扩展的 JSON 文件名)", lenght = 64, cloum = "PAGE_ID")
    private String PAGE_ID;

    @Transient
    private String PAGE_NAME;//页面名称

    @Filed(comment = "序号", lenght = 10, cloum = "SEQ")
    private Integer SEQ;
    @Filed(comment = "删除标记", lenght = 1, cloum = "DELETED")
    private String DELETED;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Filed(comment = "创建时间", lenght = 19, cloum = "CREATED_AT")
    private LocalDateTime CREATED_AT;
    @Filed(comment = "创建人员", lenght = 64, cloum = "CREATED_BY")
    private String CREATED_BY;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Filed(comment = "更新时间", lenght = 19, cloum = "UPDATED_AT")
    private LocalDateTime UPDATED_AT;
    @Filed(comment = "更新人员", lenght = 64, cloum = "UPDATED_BY")
    private String UPDATED_BY;

    @Filed(comment = "对应apipost", lenght = 64, cloum = "apipostMenuId")
    private String apipostMenuId;

    @Filed(comment = "是否已经推送", lenght = 64, cloum = "apipostMenuId")
    private String syncApipost;

    @Transient
    private String creater;

    @Transient
    private String label;

    @Transient
    private String value;

    @Transient
    private List<SysMenu> children;

}